www.mxdraw.com
内容索引主面
前一个向上下一个
IMxDrawDatabase::Insert 方法

把一个数据库当着图块插入到当前数据库中,多用于图块插入操作

IDL
[helpstring("method Insert")]
HRESULT Insert([in] IMxDrawDatabase* pDb, [in] BSTR pszBlockName, [out,retval] LONGLONG* lBlockId);
参数 
说明 
[in] IMxDrawDatabase* pDb 
插入的数据库 
[in] BSTR pszBlockName 
新插入的图块表记录名 

返回插入的图块记录id

例如: VC2005 COM

    IDispatchPtr spDispatch(m_ocx.GetDatabase(),false);

    IMxDrawDatabasePtr spDatabase;
    spDispatch->QueryInterface(&spDatabase);

    IMxDrawDatabasePtr spInsertDatabase;
    spInsertDatabase.CreateInstance(__uuidof( MxDrawXLib::MxDrawDatabase ));

    CString sFile;
    sFile.Format(_T("%s\blk\树.dwg"),m_ocx.GetOcxAppPath());

    _bstr_t sBsFile = sFile.AllocSysString();
    spInsertDatabase->ReadDwgFile(sBsFile,_T(""));


    __int64 lId = spDatabase->Insert(spInsertDatabase,_T("Tree"));

    m_ocx.DrawBlockReference(0,0,_T("Tree"),1.0,0.0);
    m_ocx.ZoomAll();
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!